<?php
/**
 * Error Controller
 * @author Tomas Srna
 * @package bakalarka
 */

class ErrorController extends Controller
{
	/**
	 * Error mozme zobrazit aj neprihlasenemu
	 */	
	public function preDispatch()
	{
		// ...
	}
	
	/**
	 * Index Action
	 */
	function index()
	{
		$template = Template::instance();
		//$template->auth = Auth::instance();
		$template->title = L::selected()->error404Title;
		$template->text = sprintf(L::selected()->error404Text, htmlentities(getenv('REQUEST_URI')));
		$template->render('error');
	}
	
	/**
	 * Inactivity Action
	 */
	function inactivity()
	{
		$t = Template::instance();
		//$t->auth = Auth::instance();
		$t->title = L::selected()->error;
		$t->text = sprintf(L::selected()->errorInactivity, Config::$inactivity);
		$t->render('error');
	}
}